
<?php if(!empty($_SESSION['member_id'])) { ?>
<script type="text/javascript">
$(document).ready(function(){
    //分享
    $("#btn_sns_share").click(function(){
        $("#commend_message").val("");
        $("#_share_title").html($(this).attr("data-title"));
        $("#_share_image").attr("src", $(this).attr("data-image"));
        $("#_share_publisher").html("作者：" + $(this).attr("data-publisher"));
        $("#_share_origin").html("出处：" + $(this).attr("data-origin"));
        $("#_share_publish_time").html($(this).attr("data-publish_time"));
        $("#_share_abstract").html($(this).attr("data-abstract"));
        $("#div_sns_share").show_dialog({title:'分享', width:480});
    });
    $('#commend_message').nc_text_count();
    $("#btn_share_publish").click(function(){
        if($('#commend_message').val().length <= 140) {
            $("#div_sns_share").hide();
            $("#btn_sns_share > em > b").nc_count();
            ajaxpost('share_form', '', '', 'onerror'); 
        }
    });
});
</script>
<!-- 弹出层开始 -->

<div id="div_sns_share" style="display:none;" class="cms-share">
<form action="{:url('Share/share_save',array('type'=>'Share'))}" method="post" id="share_form" class="feededitor">
  <input type="hidden" value="<?php echo $detail_object_id;?>" name="share_id">
  </input>
  <input type="hidden" value="<?php echo $share_detail['share_title'];?>" name="share_title">
  </input>
  <input type="hidden" value="{$share_detail['share__attachment_path']}/{$share_detail['share_image']}" name="share_image">
  </input>
  <dl class="share-target">
    <dt id="_share_title" class="title"></dt>    
    <dd class="cover"><a href="JavaScript: void(0);"><img id="_share_image" src="" alt="" /></a></dd>
    <dd class="sub"><span id="_share_publisher"></span><span id="_share_origin"></span><!--<span id="_share_publish_time"></span>--></dd>
    <dd class="abstract"><span id="_share_abstract"></span></dd>
  </dl>
  <div class="share-content">
    <textarea name="commend_message" id="commend_message" placeholder="喜欢就写一些推荐的理由给大家看！"></textarea>
  </div>
  <div class="handle">
    <input id="btn_share_publish" type="button" value="分享" class="button" />
    <!-- 站外分享 -->
    {include file="cms/cmsarticle/widget_share" /}
  </div>
</form>
</div>
<?php } else { ?>
<script type="text/javascript">
$(document).ready(function(){
    //登陆窗口
    $("#btn_sns_share").nc_login({
        nchash:'<?php echo getNchash();?>',
        formhash:'<?php echo \lib\Security::getTokenValue();?>',
        anchor:'cms_comment_flag'
    });
});
</script>
<?php } ?>

